/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Dao;

import HibernateUtil.HibernateUtil;
import Interface.InterfaceLogin;
import Pohos.Login;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author Duvan11
 */
//java class
public class DaoLogin implements InterfaceLogin{
     private Session session;

    @Override
    public boolean register(Login login) throws Exception {
        session = HibernateUtil.getSessionFactory().openSession();
        Transaction transaction = session.beginTransaction();
        session.save(login);
        transaction.commit();
        session.close();
        return true;
    }
}
